import React from 'react'
import PropTypes from 'prop-types'
import ListItemText from '@material-ui/core/ListItemText';
import ListItem from '@material-ui/core/ListItem'
import ListItemAvatar from '@material-ui/core/ListItemAvatar'

/**
 * 头像列表
 */
class AvatarWithTextListItem extends React.Component {
    render() {
        const {primary, secondary, inset, Avatar,Icon, ...other } = this.props
        return (
            <ListItem {...other}>
                <ListItemAvatar>
                    {Avatar}
                </ListItemAvatar>
                <ListItemText primary={primary} secondary={secondary} inset={inset}/>
                <ListItemSecondaryAction>
                    {Icon}
                </ListItemSecondaryAction>
            </ListItem>
        )
    }
}
AvatarWithTextListItem.propTypes = {
    primary: PropTypes.string.isRequired,
    secondary: PropTypes.string,
    dense: PropTypes.bool,
    classes: PropTypes.object,
    button:PropTypes.bool,
    component:PropTypes.string,
    href:PropTypes.string,
    Avatar:PropTypes.node,
    Icon:PropTypes.node
}

export default AvatarWithTextListItem